home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / SymbolicIsItInThere.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  2.5 KB  |  56 lines  |  [TEXT/KAHL]

  1. /* SymbolicIsItInThere.c */
  2. /*****************************************************************************/
  3. /*                                                                           */
  4. /*    Out Of Phase:  Digital Music Synthesis on General Purpose Computers    */
  5. /*    Copyright (C) 1994  Thomas R. Lawrence                                 */
  6. /*                                                                           */
  7. /*    This program is free software; you can redistribute it and/or modify   */
  8. /*    it under the terms of the GNU General Public License as published by   */
  9. /*    the Free Software Foundation; either version 2 of the License, or      */
  10. /*    (at your option) any later version.                                    */
  11. /*                                                                           */
  12. /*    This program is distributed in the hope that it will be useful,        */
  13. /*    but WITHOUT ANY WARRANTY; without even the implied warranty of         */
  14. /*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          */
  15. /*    GNU General Public License for more details.                           */
  16. /*                                                                           */
  17. /*    You should have received a copy of the GNU General Public License      */
  18. /*    along with this program; if not, write to the Free Software            */
  19. /*    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              */
  20. /*                                                                           */
  21. /*    Thomas R. Lawrence can be reached at tomlaw@world.std.com.             */
  22. /*                                                                           */
  23. /*****************************************************************************/
  24.  
  25. #include "MiscInfo.h"
  26. #include "Audit.h"
  27. #include "Debug.h"
  28. #include "Definitions.h"
  29.  
  30. #include "SymbolicIsItInThere.h"
  31. #include "Memory.h"
  32. #include "DataMunging.h"
  33.  
  34.  
  35. /* case insensitive thing to see if a string is in another string.  returns the position */
  36. /* if it was found or -1 if not found. */
  37. MyBoolean                        IsItInThere(char* Block, char* NullTermThing)
  38.     {
  39.         long                            BlockLen;
  40.         long                            NullTermLen;
  41.         long                            Index;
  42.  
  43.         CheckPtrExistence(Block);
  44.         BlockLen = PtrSize(Block);
  45.         NullTermLen = StrLen(NullTermThing);
  46.         for (Index = 0; Index + NullTermLen <= BlockLen; Index += 1)
  47.             {
  48.                 PRNGCHK(Block,&(Block[Index]),NullTermLen);
  49.                 if (MemEquNoCase(&(Block[Index]),NullTermThing,NullTermLen))
  50.                     {
  51.                         return True;
  52.                     }
  53.             }
  54.         return False;
  55.     }
  56.